package logger_example;


import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;

public class LoggerExample
{
  private static final Logger log = Logger.getLogger( LoggerExample.class.getName() );

  public static void main( String[] args ) throws IOException
  {
    // Kommentierung rausnehmen um in Datei zu loggen  
    //Handler handler = new FileHandler( "log_output.txt" );
    //log.addHandler( handler );
    //log.setUseParentHandlers(false); //Konsole als Output ausschalten
    
    log.info( "Let'Go !!!!111111" );
    try
    {
      ((Object) null).toString();
    }
    catch ( Exception e )
    {
      log.log( Level.SEVERE, "bad bad bad", e );
    }

    log.info( "Yeah i'm alive" );
  }
}